package com.hainabo.mgcmall;

import com.hainabo.mgcmall.filter.UserFilter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;

@ComponentScan(basePackages = { "com.hainabo.mgcmall", "com.hainabo.bootside.core" })
@SpringBootApplication
public class HnstfApplication {

	public static void main(String[] args) {

        SpringApplication.run(HnstfApplication.class, args);

	}

	@Bean
	public FilterRegistrationBean userFilter() {
		FilterRegistrationBean reg = new FilterRegistrationBean();
		UserFilter filter = new UserFilter();
//		filter.setTemplate(template);
		reg.setFilter(filter);
		reg.setOrder(1);
		reg.addUrlPatterns("/api/xxx");
		return reg;
	}

}
